Skip to content

fix(tier3): reserve measured usage for in-flight attempts - #595

Merged
chrisknvidia merged 3 commits into
mainfrom
fix/christopherk/budget-inflight-reservation
Nov 15, 2026
Merged

chrisknvidia merged 3 commits into
mainfrom
fix/christopherk/budget-inflight-reservation

Conversation

@chrisknvidia

@chrisknvidia chrisknvidia commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Calibrate with one logical unit before concurrent admission, then reserve
    each attempt using the largest measured usage in each bounded dimension.
  • Wait for fresh accounting when reservations would exceed a cap. If an idle
    projection still exceeds the cap, deny the unit rather than using the old
    below-cap fallback. Preserve the budget-exhausted reason and add estimate
    provenance to not-run attempts and the canonical budget summary.
  • Release reservations on every completion path and wake waiters on
    cancellation. Expose calibration waits, estimate denials and unestimated
    admissions in metadata.
  • Document that estimates can stop a run below its cap, and that actual usage
    can still exceed estimates: there is no hard currency ceiling.

This branch is independent of the budget-reporting fix.

Verification

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes
  • Ran make lint
  • Ran make test
  • Ran make build
  • Did not add credentials, private datasets, or proprietary benchmark content

Focused checks actually run:

  • Six reservation, budget, runner, cancellation and concurrency test files:
    571 passed, 3 skipped, 2 deselected, with two existing Click warnings.
  • Ruff check: All checks passed! Formatting: 4 files already formatted.
  • Fern documentation check: 0 errors, 1 warning.

Real Docker/Harbor comparison with the same 95,000-token S7 configuration:
the revision started 4 of 12 attempts, left 8 not run, and used
62,990 tokens with no observed excess. The retained base run started
8 attempts and used 133,336 tokens, exceeding the cap by 38,336. All four
admitted revision attempts were scored, with no execution or judge failures;
the process exited 0.

The calibration pair fully finished before the next pair started. Admission
then stopped below the cap because the next pair's 47,814-token estimate
would exceed remaining capacity. This demonstrates the intended denial in
this run, not a general overshoot guarantee: actual usage can exceed estimates.

Release Impact

  • No user-visible release note needed
  • Updated CHANGELOG.md

Devin Review

Use the largest measured per-attempt usage to reserve concurrent work and wait for fresh accounting before admission. Release reservations on all completion paths, wake admission waiters on cancellation, and expose reservation metadata. Document admission-boundary limits and cover concurrent lifecycle behavior.

Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Serialize one calibration unit and enforce measured per-attempt estimates even when no work is in flight. Distinguish estimate-based exhaustion in not-run records, metadata and budget summaries, and update concurrency tests and documentation.

Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread tests/tier3/test_budget_reservation.py Resolved
@chrisknvidia
chrisknvidia merged commit eba4338 into main Nov 15, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant